import request from '@/http/request';
import { IMenu } from '@/types/api';

export default {
    // 获取菜单列表
    getMenusList(params?: IMenu.Params) {
        return request.get<IMenu.MenuItem[]>('/menus/list', params);
    },
    // 创建菜单
    createMenu(data: IMenu.CreateParams) {
        return request.post('/menus/create', data);
    },
    // 编辑菜单
    editMenu(data: IMenu.EditParams) {
        return request.post('/menus/edit', data);
    },
    // 删除菜单
    delMenu(data: IMenu.DelParams) {
        return request.post('/menus/delete', data);
    }
};
